<!--
 * @Author: JPeng 872639397@qq.com
 * @Date: 2022-09-14 20:06:00
 * @LastEditors: JPeng 872639397@qq.com
 * @LastEditTime: 2022-09-14 20:09:19
 * @FilePath: \review-review-review\复习！！！\leetcode\9\14.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num = 100
        let sec = 10
        let arr = new Array(num).fill(true)
        let dlit = 0;
        let now = 0;
        let nowsec = 0;
        while (true) {
            now++;
            if (now >= num) now = 0;
            if (!arr[now]) continue;
            nowsec++;
            if (nowsec == sec) {
                dlit++;
                arr[now] = false
                now++
                while (true) {
                    if (now >= num) now = 0;
                    if (arr[now]) break;
                    now++
                }
                if (now >= num) now = 0;
                nowsec = 0
            }
            if (dlit >= num - 1) {
                break;
            }
        }
        console.log(now)
    </script>

</body>

</html>